package com.xxg.renrenorder.dao.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 售后订单信息
 *
 * @author xxg
 * @date 2020/11/16
 */
@Data
@Document(collection = "afterSalesOrderInfo")
@ApiModel(value = "AfterSalesOrderInfo", description = "售后订单信息参数")
public class AfterSalesOrderInfo {
    @ApiModelProperty(value = "售后订单ID", hidden = true)
    private String id;
    @NotNull(message = "orderId不能为null")
    @ApiModelProperty(value = "订单ID", required = true)
    private String orderId;
    @ApiModelProperty(value = "商品ID", hidden = true)
    private Integer skuId;
    @ApiModelProperty(value = "会员ID")
    private Integer userId;
    @ApiModelProperty(value = "订单创建时间", hidden = true)
    private Date createTime;
    @ApiModelProperty(value = "订单更新时间", hidden = true)
    private Date updateTime;
    @NotNull(message = "afterSalesType不能为null")
    @ApiModelProperty(value = "售后原因类型", required = true)
    private Integer afterSalesType;
    @NotNull(message = "reasonType不能为null")
    @ApiModelProperty(value = "具体原因类型", required = true)
    private Integer reasonType;
    @ApiModelProperty(value = "其他原因或说明")
    private String otherReason;
    @ApiModelProperty(value = "图片")
    private List<String> images;
    /**
     * 售后状态:0-待审核，1-等待退货，2-退款中，3-退款完成,4-审核不通过
     */
    @ApiModelProperty(value = "售后状态", hidden = true)
    private Integer status;
    @ApiModelProperty(value = "审核反馈信息", hidden = true)
    private String response;
    @ApiModelProperty(value = "审核的原因", hidden = true)
    private Boolean verifyType;
    @ApiModelProperty(value = "审核的备注", hidden = true)
    private String verifyRemark;
    @ApiModelProperty(value = "true-缺货，false-不缺货", hidden = true)
    private Boolean lessQuantity;
    @ApiModelProperty(value = "退款总金额", hidden = true)
    @Field(targetType = FieldType.DECIMAL128)
    private BigDecimal returnPay;
    @Valid
    @NotNull(message = "productInfo不能为null")
    @ApiModelProperty(value = "商品信息", required = true)
    private ProductInfo productInfo;
    @ApiModelProperty(value = "物流信息")
    private List<ExpressInfo> expressInfo;
    @ApiModelProperty(value = "退款支付信息", hidden = true)
    private PaymentInfo paymentInfo;
    /**
     * 是否删除，false-未删除，true-已删除
     */
    @ApiModelProperty(value = "是否删除", hidden = true)
    private Boolean deleted;
    @ApiModelProperty(value = "退款部分的扣款", hidden = true)
    @Field(targetType = FieldType.DECIMAL128)
    private BigDecimal cutPayment;
    @ApiModelProperty(value = "补的运费差价", hidden = true)
    @Field(targetType = FieldType.DECIMAL128)
    private BigDecimal offsetExpressFee;
    @ApiModelProperty(value = "使用的退款规则说明", hidden = true)
    private String refundReason;
    @ApiModelProperty(value = "实际退款金额", hidden = true)
    @Field(targetType = FieldType.DECIMAL128)
    private BigDecimal realReturnPay;
    @NotNull(message = "number不能为null")
    @Min(value = 0, message = "number的值不能小于0")
    @ApiModelProperty(value = "部分退款/退货/换货/补寄/维修的数量")
    private Integer number;
    @ApiModelProperty(value = "售后进度", hidden = true)
    private List<AfterSalesStep> afterSalesSteps;
    @ApiModelProperty(value = "申请退款金额（仅退款、退货退款时必填）")
    private BigDecimal applyReturnPay;
    @ApiModelProperty(value = "维修完成、换货完成、补寄完成、补寄零件完成已寄回的物流信息")
    private List<ExpressInfo> backExpressInfo;
    @ApiModelProperty(value = "收货地址信息", hidden = true)
    private AddressInfo addressInfo;
    @ApiModelProperty(value = "已经点击退款 true-已点击")
    private Boolean hasClickReFund;
    @ApiModelProperty(value = "指定的退款比例")
    private BigDecimal reFundRatio;
}
